Minor fix for eshell-previous-matching-input (Bug#7585).
authorLeo <sdl.web@gmail.com>
Fri, 17 Dec 2010 11:04:40 +0000 (19:04 +0800)
committerChong Yidong <cyd@stupidchicken.com>
Fri, 17 Dec 2010 11:04:40 +0000 (19:04 +0800)
* lisp/eshell/em-hist.el (eshell-previous-matching-input): Signal error
if point is not behind eshell-last-output-end (Bug#7585).

lisp/ChangeLog
lisp/eshell/em-hist.el

index 267d3acba2427ec1f3955efb008c51843ee3efe2..20402d7cfb18d07af1503fad58598fb035e8af59 100644 (file)
@@ -1,3 +1,8 @@
+2010-12-17  Leo  <sdl.web@gmail.com>
+
+       * eshell/em-hist.el (eshell-previous-matching-input): Signal error
+       if point is not behind eshell-last-output-end (Bug#7585).
+
 2010-12-16  Chong Yidong  <cyd@stupidchicken.com>
 
        * textmodes/rst.el (rst-compile-pdf-preview)
index 37a926f888a283b9c9fb4226d0c32b407dab7ba9..7f2e3b4b1a5f381c6f71b4953353996abe1899e1 100644 (file)
@@ -837,6 +837,8 @@ With prefix argument N, search for Nth previous match.
 If N is negative, find the next or Nth next match."
   (interactive (eshell-regexp-arg "Previous input matching (regexp): "))
   (setq arg (eshell-search-arg arg))
+  (if (> eshell-last-output-end (point))
+      (error "Point not located after prompt"))
   (let ((pos (eshell-previous-matching-input-string-position regexp arg)))
     ;; Has a match been found?
     (if (null pos)
@@ -844,7 +846,7 @@ If N is negative, find the next or Nth next match."
       (setq eshell-history-index pos)
       (unless (minibuffer-window-active-p (selected-window))
        (message "History item: %d" (- (ring-length eshell-history-ring) pos)))
-       ;; Can't use kill-region as it sets this-command
+      ;; Can't use kill-region as it sets this-command
       (delete-region eshell-last-output-end (point))
       (insert-and-inherit (eshell-get-history pos)))))